﻿<UserControl x:Class="gestadh45.wpf.UserControls.EquipementsUC.GestionLocalisationsEquipementsUC"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
 	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
	xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
	xmlns:uc="clr-namespace:gestadh45.wpf.UserControls"
 	xmlns:enum="clr-namespace:gestadh45.business.Enums;assembly=gestadh45.business"
 	xmlns:model="clr-namespace:gestadh45.model;assembly=gestadh45.model"
	xmlns:res="clr-namespace:gestadh45.wpf.Ressources"
 	mc:Ignorable="d" 
 	d:DesignHeight="500" d:DesignWidth="600">
	<DockPanel Margin="5,5,5,5">
		<TextBlock DockPanel.Dock="Top"
			Text="{Binding Source={x:Static enum:CodesUC.GestionLocalisationsEquipements}, Converter={StaticResource ResourceKey=CodeUCToString}}"
			HorizontalAlignment="Stretch" Margin="0,5,0,10" 
			TextAlignment="Center" Style="{StaticResource ResourceKey=titreUC}" />
	
		<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,10">
			<TextBox Name="tbxFiltre" Width="300" HorizontalAlignment="Left">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="TextChanged">
						<cmd:EventToCommand
									Command="{Binding Path=FilterCommand, Mode=OneWay}"
									CommandParameter="{Binding ElementName=tbxFiltre, Path=Text}" />
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</TextBox>
		</StackPanel>
	
		<ListBox Name="lbxItems" Width="500"
				 ItemsSource="{Binding Path=Items}" 
		         SelectionMode="Extended">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<TextBlock>
						<TextBlock.Text>
							<MultiBinding StringFormat="{}{0} - {1}">
								<Binding Path="." />
								<Binding Path="Localisation" />
							</MultiBinding>
						</TextBlock.Text>
					</TextBlock>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
	
		<ScrollViewer VerticalScrollBarVisibility="Auto" CanContentScroll="True" DockPanel.Dock="Right">
			<StackPanel Margin="20,0,0,0" Orientation="Vertical">
				<GroupBox Header="{x:Static res:UI_Labels.Head_DeplacerEquipements}" Margin="0,0,0,10">
					<StackPanel Orientation="Horizontal">
						<ComboBox Name="cmbLocalisations" Width="200" Height="25" 
								  ItemsSource="{Binding Path=Localisations}"
								  SelectedItem="{Binding Path=SelectedLocalisation}"/>
	
						<Button ToolTip="{x:Static res:UI_Labels.Tltp_Deplacer}" Margin="10,0,0,0" Style="{StaticResource ResourceKey=bigButton}"
								Command="{Binding Path=DeplacerEquipementsCommand}"
								CommandParameter="{Binding ElementName=lbxItems, Path=SelectedItems}">
							<Image Source="/gestadh45.wpf;component/Images/btn_right.png" />
						</Button>
					</StackPanel>
				</GroupBox>
			</StackPanel>
		</ScrollViewer>
	</DockPanel>
</UserControl>